package com.itheima.service.impl;

import com.itheima.damain.Teacher;
import com.itheima.dao.imp.TeacherDaolmpl;
import com.itheima.service.lnter.ITeacherService;

import java.util.ArrayList;

public class TeacherServicelmpl implements ITeacherService {

    private TeacherDaolmpl teacherDaolmpl = new TeacherDaolmpl();

    @Override    // 添加老师
    public void addTeacher(Teacher teacher) {
        teacherDaolmpl.addTeacher(teacher);
    }

    @Override   // 删除老师
    public void deleteTeacher(String sid) {
        teacherDaolmpl.deleteTeacher(sid);
    }

    @Override   // 修改老师
    public void updateTeacher(String sid, Teacher teacher) {
        teacherDaolmpl.updateTeacher(sid, teacher);
    }

    @Override // 查看老师
    public ArrayList<Teacher> findAllTeacher() {
        ArrayList<Teacher> teacher = teacherDaolmpl.findAllTeacher();
        if (teacher != null && teacher.size() > 0) {
            return teacher;
        }
        return null;
    }

    public boolean isExtsis(String sid) {
        return false;
    }
}
